package com.sansecy.monitor.see;

import android.app.Application;
import android.view.View;

import com.sansecy.monitor.utils.SeeExecutors;

/**
 * @Description 查看器
 * @Date 2019-08-03 10:56
 * @Created by caoyu
 */
public class See {

    public static Application sApplication;

    public static void init(Application application) {
        sApplication = application;
        application.registerActivityLifecycleCallbacks(new SeeActivityLifecycleCallbacks());
    }

    public static void showNormal(final int logId, final LogBean logBean) {
        SeeExecutors.getInstance().mainThread().execute(new Runnable() {
            @Override
            public void run() {
                LogView.mLogAdapter.addLog(logBean);
            }
        });
    }

    public static void showError(final int logId, final LogBean logBean) {
        SeeExecutors.getInstance().mainThread().execute(new Runnable() {
            @Override
            public void run() {
                LogView.mLogAdapter.addLog(logBean);
            }
        });
    }

    public static int generateId() {
        return View.generateViewId();
    }

}
